<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>网页版微信</title>
</head>
<body>
    <img id="qrcode" src="https://login.weixin.qq.com/qrcode/{{ qrcode }}">
    <script src="http://code.jquery.com/jquery-1.12.4.min.js"></script>
    <script>
        $(function(){
            checkLogin();
        });
        function checkLogin() {
            $.ajax({
                url:'/check-login.html',
                type:'GET',
                dataType:'JSON',
                 success:function(arg){
                    if (arg.code == 408){
                    checkLogin()
                    }else if (arg.code == 201){
                        $('#qrcode').attr('src',arg.data);
                        checkLogin()
                    }else if (arg.code == 200){
                        location.href = '/user.html'
                    }
           } })
        }
    </script>
</body>
</html>